﻿@model NamespaceDocumentation

@using ApiDoc


@{
    ViewBag.Title = Model.Name;
}

<h1>@Model.Name</h1>

@{
    // Build a list of parent namespaces.
    var parentTree = new List<NamespaceDocumentation>();
    for (var parentNamespace = Model.ParentNamespace; parentNamespace != null; parentNamespace = parentNamespace.ParentNamespace) {
        parentTree.Insert(0, parentNamespace); // Always put at the start.
    }
}

@if (parentTree.Any()) {
    <div>
        <h2>Parent Namespace</h2>

        <ul>
            @foreach (var namespacex in parentTree) {
                <li>
                    @Html.ApiDocumentationLink(namespacex)
                </li>
            }
        </ul>
    </div>
}

@if (Model.Namespaces.Any()) {
    <div>
        <h2>Child Namespaces</h2>
        <table class="members">
            <thead>
                <tr>
                    <th>
                    </th>
                    <th>
                        Name
                    </th>
@*                    <th>
                        Description
                    </th>*@
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Namespaces) {
                    <tr>
                        <td>
                        </td>
                        <td>
                            @Html.ApiDocumentationLink(item)
                        </td>
                       @* <td>
                            @Model.Description
                        </td>*@
                    </tr>
                }
            </tbody>
        </table>
    </div>
}

@if (Model.Classes.Any()) {
    <div>
        <h2>Classes</h2>
        <table class="members">
            <thead>
                <tr>
                    <th>
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        Description
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Classes) {
                    <tr>
                        <td>
                            @(item.Modifiers == "public"? String.Empty: item.Modifiers)
                        </td>
                        <td>
                            @Html.ApiDocumentationLink(item)
                        </td>
                        <td>
                            @item.Description
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
}

@if (Model.Interfaces.Any()) {
    <div>
        <h2>Interfaces</h2>
        <table class="members">
            <thead>
                <tr>
                    <th>
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        Description
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Interfaces) {
                    <tr>
                        <td>
                            @(item.Modifiers == "public"? String.Empty: item.Modifiers)
                        </td>
                        <td>
                            @Html.ApiDocumentationLink(item)
                        </td>
                        <td>
                            @item.Description
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
}

@if (Model.Enums.Any()) {
    <div>
        <h2>Enumerators</h2>
        <table class="members">
            <thead>
                <tr>
                    <th>
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        Description
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Enums) {
                    <tr>
                        <td>
                            @(item.Modifiers == "public"? String.Empty: item.Modifiers)
                        </td>
                        <td>
                            @Html.ApiDocumentationLink(item)
                        </td>
                        <td>
                            @item.Description
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
}


